package methodReference;

import java.util.function.Function;
import java.util.function.Supplier;

/**
 * 构造器引用
 * 数组引用
 */
public class Demo02 {
    public static void main(String[] args) {

    }

    //1.构造器引用
    public static void test01() {
        Supplier<Demo01.User> supplier = () -> new Demo01.User();

        Supplier<Demo01.User> supplier1 = Demo01.User::new;
    }

    //2.数组引用
    public static void test02() {
        Function<Integer, Integer[]> function = length -> new Integer[length];

        Function<Integer, Integer[]> function1 = Integer[]::new;

    }
}
